/**
* Created by wust on 2020-07-04 13:40:18.
*/
<template>
   <div>
     <el-button-group style="margin-bottom: 5px;">
       <el-button size="mini" type="primary" v-file-download-directive="'test_template.xls'">下载模版</el-button>
     </el-button-group>
     <el-form  label-width="120px" @submit.native.prevent>
       <file-upload-component :src="uploadUrl" :fileType="'xls,xlsx'" :fileSize="10" :fileNumber="1" v-on:importCallback="importCallback"></file-upload-component>
     </el-form>
   </div>
</template>
<script>
import Vue from 'vue'
import FileUploadComponent from '@/common/component/file-upload-component.vue'
export default {
    name: 'test-import',
    components: {
     FileUploadComponent
    },
    data () {
     return {
       uploadUrl: Vue.$demo1ServerURL + '/web/v1/TestController/importByExcel?xmlName=demo1_server_test'
     }
    },
    methods: {
     importCallback: function (e) { // 回调
       this.$confirm('导入完成，需要跳转到结果页面吗？', '询问', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
         this.$router.push({path: '/MyImportExportList'})
       }).catch(() => {
       })
     }
    }
}
</script>
